'''
 虚拟环境：  !/usr/bin/env python
 -*- coding: utf-8 -*-
 @Time    : 2025/1/13 22:43
 @Author  : 小呆呆不爱睡觉
 @File    : 测试文件.py
 @Software: PyCharm
 '''


class Person:
    name = None
    age = None
    __score = None

    def __init__(self, name, age):
        print("调用构造方法")
        self.name = name
        self.age = age
        self.__score = 97

    def __check_score(self):
        if self.__score < 60:
            return "成绩不合格，叫家长来一下"
        else:
            return "成绩合格，继续上课"

    def __str__(self):
        return f"姓名：{self.name}，年龄：{self.age},分数：{self.__score},{self.__check_score()}"

    def __eq__(self, other):
        return self.age == other.age

    # 检查学生成绩是否合格，不合格的话，叫家长来一下，否则就是成绩合格继续上课


zhangsan = Person("张三", 18)
print(zhangsan)

lisi = Person("李四", 18)

print(zhangsan == lisi)
print(zhangsan.age)
# print(zhangsan.__score)
# zhangsan.__check_score() 私有方法不能被外部调用
